import http from "../utils/http/service";
// import qs from "qs";

// ----------------------------到货验收相关--------------------------------------------

// 获取到货验收列表信息
export const postArvAccList = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/arvAccList", data);
};

// 删除到货流程
export const postDeleteArv = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/delete", data);
};

// 发起到货验收
export const postArvNoticeStart = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/arvNoticeStart", data);
};

// 获取详情
export const postArvAccFlowInfo = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/arvAccFlowInfo", data);
};

// 提交表单信息，进入下一个流程
export const postNoticeRcpSubmit = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/noticeRcpSubmit", data);
};

// 驳回表单
export const postArrivalAccReject = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/arrivalAccReject", data);
};

// 暂存表单 发起流程的第一步保存
export const poststorageArvNotice = (data): any => {
  return http.post("/snow-admin/arrivedAcceptance/storageArvNotice", data);
};

// 保存表单
export const postStorageTmpData = (data): any => {
  return http.post("/snow-admin/flow/common/storageTmpData", data);
};

// 获取保存表单
export const postGetStorageTmpData = (data): any => {
  return http.post("/snow-admin/flow/common/getStorageTmpData", data);
};

// 转交处理表单
export const postChangeAssignee = (data): any => {
  return http.post("/snow-admin/flow/common/changeAssignee", data);
};

// 获取基础信息
export const getContractInfo = (data): any => {
  return http.get(
    `/snow-admin/arrivedAcceptance/contractInfo/${data.contractId}`
  );
};

// 获取流程记录信息
export const postApproveHistory = (data): any => {
  return http.post(`/snow-admin/flow/common/approveHistory/${data.instanceId}`);
};

// 获取项目列表数据
export const postProjectTree = (data): any => {
  return http.post("/snow-admin/projectManage/projectTree", data);
};

// 获取合同目列表数据
export const postGetContractList = (data): any => {
  return http.post("/snow-admin/projectManage/getContractList", data);
};

// 根据合同id获取合同相关信息
export const getContractDetail = (data): any => {
  return http.get(`/snow-admin/projectContract/detail/${data.id}`);
};

// 根据验收结果id 获取验收数据
export const getsceneAcceptance = (data): any => {
  return http.get(`/snow-admin/arrivedAcceptance/sceneAcceptance/${data.id}`);
};

// 撤回
export const postRecall = (data): any => {
  return http.post(`/snow-admin/flow/common/recall`, data);
};

// 项目组成员获取
export const getProTeamMembers = (data): any => {
  return http.get(`/snow-admin/projectContract/proTeamMembers/${data.id}`);
};

// ------------------------------------------------------
// 通用流程接口
export const postComFlowList = (data): any => {
  return http.post(`/snow-admin/flowForm/flowList`, data);
};

// 通用流程接口
export const postComFlowDelete = (data): any => {
  return http.post(`/snow-admin/flowForm/delete`, data);
};

// 通用流程接口发起
export const postComFlowStart = (data): any => {
  return http.post(`/snow-admin/flowForm/flowStart`, data);
};

// 通用流程接口提交
export const postComFlowSubmit = (data): any => {
  return http.post(`/snow-admin/flowForm/flowSubmit`, data);
};

// 通用流程接口获取信息
export const getFlowInfo = (data): any => {
  return http.get(`/snow-admin/flowForm/flowInfo/${data.id}`);
};

// 通用流程接口驳回
export const postFlowReject = (data): any => {
  return http.post(`/snow-admin/flowForm/flowReject`, data);
};

// 通用流程接口保存
export const postFlowSave = (data): any => {
  return http.post(`/snow-admin/flowForm/storageFlowdata`, data);
};

// ----------------------------------- end -------------------------------------------
